<template>
	<view class="page">

		<view class="top-bg">
			<view class="top-box-img" :style="{backgroundImage:'url('+mineTopBg+')'}"></view>
		</view>
		<view class="container">
			<!-- 流星-->
			<view class="tn-satr">
				<view class="sky"></view>
				<view class="stars">
					<view class="falling-stars">
						<view class="star-fall"></view>
						<view class="star-fall"></view>
						<view class="star-fall"></view>
						<view class="star-fall"></view>
					</view>
					<view class="small-stars">
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
					</view>
					<view class="medium-stars">
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
						<view class="star"></view>
					</view>
				</view>
			</view>

			<view class="msg-container">

				<view class="msg-box">
					<image v-if="appConfig.companyRespVO" class="msg-box--image" mode="aspectFit" :src="appConfig.companyRespVO.logoText"></image>
					<image v-else class="msg-box--image" mode="aspectFit" src="../static/images/logo_text.png"></image>
					
					<view class="msg-box--title">
						<view>{{ appConfig.appTitle || '曲靖市马龙区中医医院'}}</view>
					</view>

					<view class="msg-box--content">
						<view class="msg-content">
							<image mode="heightFix" class="msg-content__image" src="../static/images/icon_update.png"></image>
							<view class="msg-content__title">
								{{ msgData.value }}
							</view>
							<view class="msg-content__des">
								{{ msgData.remark }}
							</view>
						</view>
					</view>
					
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	const app = getApp();
	import * as api from '@/api/api.js';
	import * as config from '@/api/config.js';
	import {
		mapGetters
	} from "vuex";
	export default {
		computed: mapGetters(['appConfig']),
		data() {
			return {
				loading: false,
				borderRadius:40,
				msgData:{},
				content:'',
				size: 40,
				msg: '',
				mineTopBg: ''
			}
		},
		onLoad(options) {
			console.info("wechat_login options")
			console.table(options)
			this.msg = options.msg;
			if(this.msg){
				this.msgData.value = this.msg;
			}else{
				this.getData();
			}
		},
		methods: {
			getData() {
				let that = this;
				api.getConfigByKey(config.CONFIG_TYPE.CLOSE_CONFIG).then(res => {
					console.table(res);
					if (res.code === 0 && res.data.visible) {
						that.msgData = res.data;
					}else {
						uni.switchTab({
							url: '/main/index/index'
						})
					}
				}).catch(err => {
				
				})
				
				api.getMineData().then(res => {
					if (res.code === 0) {
						this.mineTopBg = res.data.mineTopBg;
					}
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	
	.msg-content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	
		&__icon {
			font-size: 200rpx;
			color: $dawn-theme-color;
			font-weight: 0;
		}
	
		&__image {
			// width: 160px;
			height:  120px;
			// height: 200rpx;
		}
	
		&__title {
			margin-top: 20rpx;
			font-size: $dawn-font-size-xl;
			font-weight: bolder;
			color: #000;
		}
		
		&__des {
			font-size: $dawn-font-size-md;
			font-weight: bolder;
			color: $dawn-color-danger;
			line-height: 65rpx;
		}
	
		&__text {
			font-size: $uni-font-size-base;
			color: $dawn-color-grey;
		}
		
		&__btn {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 30rpx;
			font-size: $dawn-font-size-md;
			font-weight: bolder;
			color: $dawn-theme-color-dark;
		}
	}
	
	
	.msg-container {
		position: relative;
		// margin-top: -280px;
		margin-top: - $dawn-top-bg-height;
		// padding: 20rpx 30rpx 40rpx 30rpx;
		padding: $dawn-page-container-padding;
		width: 100%;
		height: 100vh;
		display: flex;
		align-items: center;
	}

	.msg-box {
		z-index: 10000;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 50vh;
		background-color: #FFFFFF;
		box-shadow: $dawn-box-shadow;
		border-radius: $dawn-border-radius;

		&--image {
			border-radius: 8rpx;
			// width: 100%;
			height: 120rpx;
			margin-bottom: 30rpx;
		}

		&--title {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-bottom: 100rpx;
			// margin-bottom: 12vh;
			color: $dawn-theme-color;
			font-size: $dawn-font-size-xl;
			font-weight: bolder;
		}

		&--desc {
			color: $dawn-color-grey;
			font-size: $dawn-font-size-md;
			font-weight: bolder;
			margin-top: 30rpx;
		}

		&--content {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-bottom: 30rpx;
		}

		&--btn {
			width: 100%;
			display: flex;
			justify-content: center;
		}
	}

	::v-deep .tn-checkbox__label {
		margin-left: 0px !important;
		margin-right: 10rpx !important;
	}


	/* 流星*/
	.tn-satr {
		position: fixed;
		width: 100%;
		// height: 600px;
		height: 90vh;
		overflow: hidden;
		flex-shrink: 0;
		z-index: 998;
	}

	.stars {
		position: absolute;
		z-index: 1;
		width: 100%;
		height: 400px;
	}

	.star {
		border-radius: 50%;
		// background: #ffffff;
		background: $dawn-theme-color;
		box-shadow: 0px 0px 6px 0px rgba(255, 255, 255, 0.8);
	}

	.small-stars .star {
		position: absolute;
		width: 3px;
		height: 3px;
	}

	.small-stars .star:nth-child(2n) {
		opacity: 0;
		-webkit-animation: star-blink 1.2s linear infinite alternate;
		animation: star-blink 1.2s linear infinite alternate;
	}

	.small-stars .star:nth-child(1) {
		left: 40px;
		bottom: 50px;
	}

	.small-stars .star:nth-child(2) {
		left: 200px;
		bottom: 40px;
	}

	.small-stars .star:nth-child(3) {
		left: 60px;
		bottom: 120px;
	}

	.small-stars .star:nth-child(4) {
		left: 140px;
		bottom: 250px;
	}

	.small-stars .star:nth-child(5) {
		left: 400px;
		bottom: 300px;
	}

	.small-stars .star:nth-child(6) {
		left: 170px;
		bottom: 80px;
	}

	.small-stars .star:nth-child(7) {
		left: 200px;
		bottom: 360px;
		-webkit-animation-delay: .2s;
		animation-delay: .2s;
	}

	.small-stars .star:nth-child(8) {
		left: 250px;
		bottom: 320px;
	}

	.small-stars .star:nth-child(9) {
		left: 300px;
		bottom: 340px;
	}

	.small-stars .star:nth-child(10) {
		left: 130px;
		bottom: 320px;
		-webkit-animation-delay: .5s;
		animation-delay: .5s;
	}

	.small-stars .star:nth-child(11) {
		left: 230px;
		bottom: 330px;
		-webkit-animation-delay: 7s;
		animation-delay: 7s;
	}

	.small-stars .star:nth-child(12) {
		left: 300px;
		bottom: 360px;
		-webkit-animation-delay: .3s;
		animation-delay: .3s;
	}

	@-webkit-keyframes star-blink {
		50% {
			width: 3px;
			height: 3px;
			opacity: 1;
		}
	}

	@keyframes star-blink {
		50% {
			width: 3px;
			height: 3px;
			opacity: 1;
		}
	}

	.medium-stars .star {
		position: absolute;
		width: 3px;
		height: 3px;
		opacity: 0;
		-webkit-animation: star-blink 1.2s ease-in infinite alternate;
		animation: star-blink 1.2s ease-in infinite alternate;
	}

	.medium-stars .star:nth-child(1) {
		left: 300px;
		bottom: 50px;
	}

	.medium-stars .star:nth-child(2) {
		left: 400px;
		bottom: 40px;
		-webkit-animation-delay: .4s;
		animation-delay: .4s;
	}

	.medium-stars .star:nth-child(3) {
		left: 330px;
		bottom: 300px;
		-webkit-animation-delay: .2s;
		animation-delay: .2s;
	}

	.medium-stars .star:nth-child(4) {
		left: 460px;
		bottom: 300px;
		-webkit-animation-delay: .9s;
		animation-delay: .9s;
	}

	.medium-stars .star:nth-child(5) {
		left: 300px;
		bottom: 150px;
		-webkit-animation-delay: 1.2s;
		animation-delay: 1.2s;
	}

	.medium-stars .star:nth-child(6) {
		left: 440px;
		bottom: 120px;
		-webkit-animation-delay: 1s;
		animation-delay: 1s;
	}

	.medium-stars .star:nth-child(7) {
		left: 200px;
		bottom: 140px;
		-webkit-animation-delay: .8s;
		animation-delay: .8s;
	}

	.medium-stars .star:nth-child(8) {
		left: 30px;
		bottom: 480px;
		-webkit-animation-delay: .3s;
		animation-delay: .3s;
	}

	.medium-stars .star:nth-child(9) {
		left: 460px;
		bottom: 400px;
		-webkit-animation-delay: 1.2s;
		animation-delay: 1.2s;
	}

	.medium-stars .star:nth-child(10) {
		left: 150px;
		bottom: 10px;
		-webkit-animation-delay: 1s;
		animation-delay: 1s;
	}

	.medium-stars .star:nth-child(11) {
		left: 420px;
		bottom: 450px;
		-webkit-animation-delay: 1.2s;
		animation-delay: 1.2s;
	}

	.medium-stars .star:nth-child(12) {
		left: 340px;
		bottom: 180px;
		-webkit-animation-delay: 1.1s;
		animation-delay: 1.1s;
	}

	@keyframes star-blink {
		50% {
			width: 4px;
			height: 4px;
			opacity: 1;
		}
	}

	.star-fall {
		position: relative;
		border-radius: 2px;
		width: 80px;
		height: 2px;
		overflow: hidden;
		-webkit-transform: rotate(-20deg);
		transform: rotate(-20deg);
	}

	.star-fall:after {
		content: "";
		position: absolute;
		width: 50px;
		height: 2px;
		background: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0)), to(rgba(255, 255, 255, 0.4)));
		background: linear-gradient(to left, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.4) 100%);
		left: 100%;
		-webkit-animation: star-fall 3.6s linear infinite;
		animation: star-fall 3.6s linear infinite;
	}

	.star-fall:nth-child(1) {
		left: 80px;
		bottom: -100px;
	}

	.star-fall:nth-child(1):after {
		-webkit-animation-delay: 2.4s;
		animation-delay: 2.4s;
	}

	.star-fall:nth-child(2) {
		left: 200px;
		bottom: -200px;
	}

	.star-fall:nth-child(2):after {
		-webkit-animation-delay: 2s;
		animation-delay: 2s;
	}

	.star-fall:nth-child(3) {
		left: 430px;
		bottom: -50px;
	}

	.star-fall:nth-child(3):after {
		-webkit-animation-delay: 3.6s;
		animation-delay: 3.6s;
	}

	.star-fall:nth-child(4) {
		left: 400px;
		bottom: 100px;
	}

	.star-fall:nth-child(4):after {
		-webkit-animation-delay: .2s;
		animation-delay: .2s;
	}

	@-webkit-keyframes star-fall {
		20% {
			left: -100%;
		}

		100% {
			left: -100%;
		}
	}

	@keyframes star-fall {
		20% {
			left: -100%;
		}

		100% {
			left: -100%;
		}
	}


	/* 波浪*/
	.container {
		// background-image: linear-gradient(to top, #afcef5 10%, #3571BB 90%);
		// background-image: url('~@/static/images/loginbg.png');
		background-size: 100% 100%;
		width: 100vw;
		height: 100vh;
		margin-top: - $dawn-top-bg-height;
	}

	@keyframes move_wave {
		0% {
			transform: translateX(0) translateZ(0) scaleY(1)
		}

		50% {
			transform: translateX(-25%) translateZ(0) scaleY(1)
		}

		100% {
			transform: translateX(-50%) translateZ(0) scaleY(1)
		}
	}

	.tnwave {
		overflow: hidden;
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		top: 0;
		margin: auto;
	}

	.waveWrapperInner {
		position: absolute;
		width: 100%;
		overflow: hidden;
		height: 100%;
	}

	.wave {
		position: absolute;
		left: 0;
		width: 200%;
		height: 100%;
		background-repeat: repeat no-repeat;
		background-position: 0 bottom;
		transform-origin: center bottom;
	}

	.bgTop {
		opacity: 0.4;
	}

	.waveTop {
		background-size: 50% 45px;
	}

	.waveAnimation .waveTop {
		animation: move_wave 4s linear infinite;
	}

	.bgMiddle {
		opacity: 0.6;
	}

	.waveMiddle {
		background-size: 50% 40px;
	}

	.waveAnimation .waveMiddle {
		animation: move_wave 3.5s linear infinite;
	}

	.bgBottom {
		opacity: 0.95;
	}

	.waveBottom {
		background-size: 50% 35px;
	}

	.waveAnimation .waveBottom {
		animation: move_wave 2s linear infinite;
	}
</style>